<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:100:"D:\PHPStudy\PHPTutorial\WWW\HM\pdingzone\public/../application/core\view\enterprise\module\home.html";i:1544678555;s:84:"D:\PHPStudy\PHPTutorial\WWW\HM\pdingzone\application\core\view\common\pc\header.html";i:1544678555;s:85:"D:\PHPStudy\PHPTutorial\WWW\HM\pdingzone\application\core\view\common\pc\widgets.html";i:1544678555;s:84:"D:\PHPStudy\PHPTutorial\WWW\HM\pdingzone\application\core\view\common\pc\footer.html";i:1544678555;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>资产管理 - <?php echo $siteConfig['siteName']; ?></title>
    <meta name="keywords" content="<?php echo $siteConfig['siteKeyword']; ?>"/>
    <meta name="description" content="<?php echo $siteConfig['siteDesc']; ?>"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="<?php echo $siteConfig['favicon']; ?>" type="image/x-icon" rel="shortcut icon"/>
    <link rel="stylesheet" href="/static/layui/2.4.3/src/css/layui.css?v=20181010_1" media="all">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_731151_u29ky3lpahq.css?v=20181010_1" media="all">
    <link rel="stylesheet" href="/static/css/pc.css?v=20181010_1" media="all">
    <script src="/static/js/jquery.min.js?v=20181010_1" charset="utf-8"></script>
    <script src="/static/layui/2.4.3/src/layui.js?v=20181010_1" charset="utf-8"></script>
    <script src="/static/js/common.js?v=20181010_1" charset="utf-8"></script>
    <script src="/static/js/pc.js?v=20181010_1" charset="utf-8"></script>

    <?php if($siteConfig['theme']): ?>
    <link rel="stylesheet" href="/static/css/theme/<?php echo $siteConfig['theme']; ?>/pc.css?v=20181010_1" media="all">
    <?php endif;  if(\think\App::$debug){  ?>
    <!-- 调试窗口 -->
    <script src="/static/js/vconsole/vconsole.min.js?v=20181010_1" charset="utf-8"></script>
    <script>
        // 调试窗口初始化
        new VConsole();
    </script>
    <?php  }  ?>
</head>

<body class="layui-layout-body pc-body">


<style>
    .widget {
        padding: 5px;
    }

    .widget .layui-card-header {
        font-size: 15px;
    }

    .widget .layui-card-header .title {
        height: 42px;
        overflow: hidden;
        white-space: nowrap;
        width: calc(100% - 10px);
        text-overflow: ellipsis;
    }
    .widget .layui-card-header .tools {
        position: absolute;
        right: 10px;
        top: 0px;
    }

    .widget .layui-card-header .tools .refresh i {
        font-size: 12px;
    }

    .widget .layui-card-body.number {
        text-align: center;
        font-size: 30px;
        height: 50px;
        line-height: 50px;
    }
</style>
<div class="widgets layui-row">
    <?php if(is_array($widgetInfos) || $widgetInfos instanceof \think\Collection || $widgetInfos instanceof \think\Paginator): if( count($widgetInfos)==0 ) : echo "" ;else: foreach($widgetInfos as $name=>$widgetInfo): ?>
    <div class="widget layui-col-xs<?php echo $widgetInfo['width'][0]; ?> layui-col-sm<?php echo $widgetInfo['width'][1]; ?> layui-col-md<?php echo $widgetInfo['width'][2]; ?> layui-col-lg<?php echo $widgetInfo['width'][3]; ?>"
         data-name="<?php echo $name; ?>" data-mid="<?php echo $widgetInfo['mid']; ?>" id="widget-<?php echo $name; ?>-<?php echo $widgetInfo['mid']; ?>">
        <div class="layui-card">
            <div class="layui-card-header">
                <div class="title" title="<?php echo $widgetInfo['title']; ?>"><?php echo $widgetInfo['title']; ?></div>
                <div class="tools">
                    <?php 
                    $refreshTip = "刷新";
                    if($widgetInfo['time']) {
                        $refreshTip = "数据刷新时间：".$widgetInfo['time'];
                    }
                     ?>
                    <a class="refresh" href="javascript:;" title="<?php echo $refreshTip; ?>">
                        <i class="layui-icon layui-icon-refresh"></i>
                        <i class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"
                           style="display: none;"></i>
                    </a>
                </div>
            </div>
            <div class="layui-card-body <?php echo $widgetInfo['type']; ?>">
                <?php echo $widgetInfo['content']; ?>
            </div>
        </div>
    </div>
    <?php endforeach; endif; else: echo "" ;endif; ?>
</div>

<script>
    $(".widget .layui-card-header .tools .refresh .layui-icon-refresh").click(function () {
        var $refresh = $(this);
        var $loading = $(this).parent().find(".layui-icon-loading");
        var $widget = $(this).parents(".widget");
        var name = $widget.attr("data-name");
        var mid = $widget.attr("data-mid");
        $refresh.hide();
        $loading.show();

        $refresh.parent().attr("title", "数据刷新中");
        $.post("/core/enterprise.module/widgetContent?eid=<?php echo $eid; ?>&mid=" + mid, {
            name: name,
            force: true
        }, function (ret) {
            if (ret.code == 1) {
                $refresh.show();
                $loading.hide();
                $widget.find(".layui-card-body").html(ret.data.content);
                $refresh.parent().attr("title", ret.data.time ? ("数据刷新时间：" + ret.data.time) : "刷新");
            } else {
                layer.alert(ret.msg);
            }
        }, "json");
    });
</script>

<?php 
if(isset($_enterprise_js_css_customize)) {
echo $_enterprise_js_css_customize;
}
 ?>
</body>
</html>